package yelmor.comm100.configure;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartException;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsFileUploadSupport;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import yelmor.comm100.bean.OpenfireApi;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by yel on 4/27/16.
 */
@Configuration
public class OpenfireApiConfig {
  @Value("${openfire.admin}")
  String openfireAdmin;

  @Value("${openfire.passwd}")
  String openfirePasswd;

  @Value("${openfire.host}")
  String openfireHost;

  @Value("${openfire.port}")
  String openfirePort;

  @Bean
  public OpenfireApi getOpenfireApi() {
    return new OpenfireApi(openfireAdmin, openfirePasswd, openfireHost, openfirePort);
  }

 /* @Bean(name = "multipartResolver")
  public MultipartResolver multipartResolver() {
    return  new CommonsMultipartResolver();
  }
*/
}
